package com.sugar.follow.up.module.business.dal.mysql.followuptemplatequestion;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.followuptemplatequestion.FollowUpTemplateQuestionDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.followuptemplatequestion.vo.*;

/**
 * 随访模板题目 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface FollowUpTemplateQuestionMapper extends BaseMapperX<FollowUpTemplateQuestionDO> {

    default PageResult<FollowUpTemplateQuestionDO> selectPage(FollowUpTemplateQuestionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FollowUpTemplateQuestionDO>()
                .eqIfPresent(FollowUpTemplateQuestionDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(FollowUpTemplateQuestionDO::getType, reqVO.getType())
                .eqIfPresent(FollowUpTemplateQuestionDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(FollowUpTemplateQuestionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FollowUpTemplateQuestionDO::getId));
    }

}